package com.copm.ifm.servers.sys.mapping;

import com.copm.ifm.servers.sys.dto.SysProjectDTO;
import com.copm.ifm.servers.sys.entity.SysProject;
import com.copm.ifm.servers.sys.entity.SysProjectDetail;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @Author msp
 * @Date 2021/5/8
 */
@Mapper
public interface SysProjMapping {

    SysProjMapping INSTANCE = Mappers.getMapper(SysProjMapping.class);

    @Mappings({
            @Mapping(source = "proName", target = "name"),
            @Mapping(source = "proCode", target = "code")
    })
    SysProject DTO2PO(SysProjectDTO dto);

    @Mapping(source = "id", target = "projectId")
    SysProjectDetail DTO2Detail(SysProjectDTO dto);
}
